/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Accueil.java
 *
 * Created on 1 juin 2011, 14:15:38
 */

package cannes.gui;

import javax.swing.JFrame;

/**
 *
 * @author p1008977
 */
public class Accueil extends javax.swing.JFrame {

    /** Creates new form Accueil */
    public Accueil() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        identifiant = new javax.swing.JTextField();
        mdp = new javax.swing.JTextField();
        acceuilOK = new javax.swing.JButton();
        acceuilFin = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD, jLabel1.getFont().getSize()+3));
        jLabel1.setText("Identifiant :");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel2.setText("Mot de passe :");

        acceuilOK.setText("OK");
        acceuilOK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acceuilOKActionPerformed(evt);
            }
        });

        acceuilFin.setText("Fin");
        acceuilFin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acceuilFinActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(57, 57, 57)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(acceuilOK)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel2)
                        .addComponent(jLabel1)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(identifiant)
                            .addComponent(mdp, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addComponent(acceuilFin)))
                .addContainerGap(75, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(52, 52, 52)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(identifiant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(mdp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(50, 50, 50)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(acceuilOK)
                    .addComponent(acceuilFin))
                .addContainerGap(42, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void acceuilFinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceuilFinActionPerformed
        dispose();
        System.exit(0);
    }//GEN-LAST:event_acceuilFinActionPerformed

    private void acceuilOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceuilOKActionPerformed
        if (identifiant.getText().equals("AdminVIP") && mdp.getText().equals("toto"))
        {
            
        }else if(identifiant.getText().equals("Admin")){
            new GestionPlanning().setVisible(true);
        }
        
        GestionPlanning gp = new GestionPlanning();
        gp.setVisible(true);
        JFrame f = new JFrame("Gestion Planning");
        f.add(gp);
        f.setSize(600, 300);
        f.setVisible(true);
        GestionVIP gv = new GestionVIP();
        gv.setVisible(true);
        JFrame f2 = new JFrame("Gestion VIP");
        f2.add(gv);
        f2.setSize(600, 300);
        f2.setVisible(true);
    }//GEN-LAST:event_acceuilOKActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Accueil().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton acceuilFin;
    private javax.swing.JButton acceuilOK;
    private javax.swing.JTextField identifiant;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JTextField mdp;
    // End of variables declaration//GEN-END:variables

}
